package com.yanqu.road.server.cmd.activity.pawnshop;

import com.yanqu.road.pb.activity.PawnshopProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.pawnshop.PawnshopModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_PAWNSHOP_NOTIFY_READ, desc = "请求当铺的弹窗通知已读")
public class PawnshopNotifyReadCmd extends AbstractCommand {

	private long notifyId;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		PawnshopProto.PawnshopNotifyReadReqMsg reqMsg = PawnshopProto.PawnshopNotifyReadReqMsg.parseFrom(packet.getBytes());
		notifyId = reqMsg.getNotifyId();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		player.getModule(PawnshopModule.class).setNotifyRead(notifyId);
	}

	@Override
	public void sendData(GamePlayer player) {

	}

}
